package com.cnap.model.schedule.engine;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.Collections;

/**
 * <类文件描述>
 *
 * @author xc
 **/
class DeployPolicyDistributeReqTest {

    @Test
    void transToJson() {
        DeployPolicyDistributeReq req = new DeployPolicyDistributeReq();

        req.setScalePolicyConfigs(Collections.singletonList("{\"policy\":\"none\"}"));
        req.setDeployPolicyConfig("config");
        req.setDeployPolicyConfig("{\"policy\":\"vm\",\"param\":[{\"id\":\"\",\"groupId\":\"\",\"type\":\"max\",\"resource\":\"cpu\",\"value\":70,\"duration\":\"5\",\"continuousNum\":3,\"num\":1,\"coolTime\":\"900\"},{\"id\":\"\",\"groupId\":\"\",\"type\":\"min\",\"resource\":\"cpu\",\"value\":30,\"duration\":\"15\",\"continuousNum\":3,\"num\":1,\"coolTime\":\"900\"}]}");
        Assertions.assertDoesNotThrow(()->{
            req.transToJson();
        });
    }
}